package com.qingke.test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Income {
    private Integer id;

    private Long amount;

    private Date eventDate;

    private Date recordDate;

    private Integer incomeTypeId;

    private String note;

    @Override
	public String toString() {
		return "Income [id=" + id + ", amount=" + amount + ", eventDate=" + eventDate + ", recordDate=" + recordDate
				+ ", incomeTypeId=" + incomeTypeId + ", note=" + note + "]";
	}

	public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Long getAmount() {
        return amount;
    }

    public void setAmount(Long amount) {
        this.amount = amount;
    }

    public Date getEventDate() {
    	SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
    	String s=sdf.format(eventDate);
        try {
			return sdf.parse(s);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        return null;
    }

    public void setEventDate(Date eventDate) {
        this.eventDate = eventDate;
    }

    public Date getRecordDate() {
    	SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
    	String s=sdf.format(recordDate);
        try {
			return sdf.parse(s);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        return null;
    }

    public void setRecordDate(Date recordDate) {
        this.recordDate = recordDate;
    }

    public Integer getIncomeTypeId() {
        return incomeTypeId;
    }

    public void setIncomeTypeId(Integer incomeTypeId) {
        this.incomeTypeId = incomeTypeId;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note == null ? null : note.trim();
    }
}